<template>
  <div class="app-container">
    <div class="block">
      <div class="title">项目详情</div>
      <el-descriptions class="margin-top" :column="3" border>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-user"></i>
            项目名称（改造老人姓名）
          </template>
          张三
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-mobile-phone"></i>
            项目编号
          </template>
          2104623
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            项目地点
          </template>
          拱墅区
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            项目状态
          </template>
          进行中
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-tickets"></i>
            项目类型
          </template>
          <el-tag size="small">基础类</el-tag>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-office-building"></i>
            项目负责人
          </template>
          李响
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            开始时间
          </template>
          2023-12-24 16:10:10
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            预计完成时间
          </template>
          2023-12-24 16:10:10
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-location-outline"></i>
            完成时间
          </template>
          2023-12-24 16:10:10
        </el-descriptions-item>
      </el-descriptions>

      <div class="title">项目进度</div>
      <div class="operate">
        <el-button size="small">任务分配</el-button>
        <span>当前任务已分配给：李响</span>
      </div>
      <!-- <el-timeline>
        <el-timeline-item
          v-for="(item, index) in projectLine"
          :key="index"
          :timestamp="item.date"
          placement="top"
        >
          <el-card>
          <h4>{{ item.detail }}</h4>
          <div v-if="item.ability" class="ability-container">
            <span style="margin-right: 20px">能力：{{ item.ability }}</span>
            <img src="@/assets/images/pdf.png" alt="" class="logo" />
            <span>评估报告</span>
          </div>
          <div v-if="item.submitter" class="ability-container">
            提交人：{{ item.submitter }}
          </div>
          <div v-if="item.report" class="ability-container">
            <img src="@/assets/images/pdf.png" alt="" class="logo" />
            <span>方案报告</span>
          </div>
          <div v-if="item.transformDetail" class="ability-container">
            <span>{{ item.transformDetail }}</span>
          </div>
          <div v-if="item.consPersonnel" class="ability-container">
            <span>施工人员：{{ item.consPersonnel }}</span>
          </div>
          <div v-if="item.passImg" class="ability-container">
            <img :src="item.passImg" alt="" class="donelogo" />
          </div>
          </el-card>
        </el-timeline-item>
      </el-timeline>
      <div class="title">售后详情</div>

      <el-timeline>
        <el-timeline-item
          v-for="(item, index) in afterSalesLine"
          :key="index"
          :timestamp="item.date"
          placement="top"
        >
          <el-card>
            <h4>{{ item.detail }}</h4>
            <div v-if="item.consPersonnel" class="ability-container">
              <span>维护人员：{{ item.consPersonnel }}</span>
            </div>
          </el-card></el-timeline-item
        >
      </el-timeline> -->

      <el-steps :active="8" align-center finish-status="success">
        <el-step
          v-for="(item, index) in projectLine"
          :key="index"
          :title="item.date"
        >
          <template slot="description">
            <h4>{{ item.detail }}</h4>
            <div v-if="item.ability" class="ability-container">
              <span>能力：{{ item.ability }}</span>
              <img src="@/assets/images/pdf.png" alt="" class="logo" />
              <span>评估报告</span>
            </div>
            <div v-if="item.submitter" class="ability-container">
              提交人：{{ item.submitter }}
            </div>
            <div v-if="item.report" class="ability-container">
              <img src="@/assets/images/pdf.png" alt="" class="logo" />
              <span>方案报告</span>
            </div>
            <div v-if="item.transformDetail" class="ability-container">
              <span>{{ item.transformDetail }}</span>
            </div>
            <div v-if="item.consPersonnel" class="user-container">
              <span>施工人员：{{ item.consPersonnel }}</span>
            </div>
            <div v-if="item.passImg" class="ability-container">
              <img :src="item.passImg" alt="" class="donelogo" />
            </div>
          </template>
        </el-step>
      </el-steps>
      <div class="title">售后详情</div>
      <el-table
        v-loading="listLoading"
        :data="afterSalesLine"
        element-loading-text="Loading"
        border
        fit
        highlight-current-row
      >
        <el-table-column label="时间" prop="date" align="center">
        </el-table-column>
        <el-table-column label="维护内容" prop="detail" align="center">
        </el-table-column>
        <el-table-column label="维护人员" prop="consPersonnel" align="center">
        </el-table-column>
      </el-table>
      <!-- <el-steps :active="1" align-center finish-status="success">
        <el-step
          v-for="(item, index) in afterSalesLine"
          :key="index"
          :title="item.date"
        >
          <template slot="description">
            <h4>{{ item.detail }}</h4>
            <div v-if="item.consPersonnel" class="ability-container">
              <span>维护人员：{{ item.consPersonnel }}</span>
            </div>
          </template>
        </el-step>
      </el-steps> -->
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      /**
       * date 日期
       * detail 详情
       * ability 能力
       * abilityFile 能力评估文件pdf
       * submitter 提交人
       * report 方案报告pdf
       * transformDetail 改造详情
       * consPersonnel 施工人员
       */
      stepInfo: {
        list: [
          { date: "2023-7-5", title: "申请" },
          {
            date: "2023-7-5",
            title: "评估",
            ability: "完好",
            abilityFile: "asjfhdsgfag"
          },
          { date: "2023-7-6", title: "方案提交", submitter: "欧阳娜" },
          { date: "2023-7-7", title: "方案通过", report: "sdjfvsdhhdaji" },
          {
            date: "2023-7-10",
            title: "地面改造",
            transformDetail: "防滑处理；卫生间更换防滑瓷砖；卧室铺设防滑地胶",
            consPersonnel: "李洋洋"
          },
          {
            date: "2023-7-18",
            title: "厕所改造",
            transformDetail: "安装扶手",
            consPersonnel: "郭西"
          },
          {
            date: "2023-7-19",
            title: "安装灯具、智能门磁、防走失装置、安全监控",
            consPersonnel: "李响"
          },
          {
            date: "2023-7-20",
            title: "验收，交工",
            passImg: require("@/assets/images/pass.png")
          }
        ]
      },
      projectLine: [
        { date: "2023-7-5", detail: "申请" },
        {
          date: "2023-7-5",
          detail: "评估",
          ability: "完好",
          abilityFile: "asjfhdsgfag"
        },
        { date: "2023-7-6", detail: "方案提交", submitter: "欧阳娜" },
        { date: "2023-7-7", detail: "方案通过", report: "sdjfvsdhhdaji" },
        {
          date: "2023-7-10",
          detail: "地面改造",
          transformDetail: "防滑处理；卫生间更换防滑瓷砖；卧室铺设防滑地胶",
          consPersonnel: "李洋洋"
        },
        {
          date: "2023-7-18",
          detail: "厕所改造",
          transformDetail: "安装扶手",
          consPersonnel: "郭西"
        },
        {
          date: "2023-7-19",
          detail: "安装灯具、智能门磁、防走失装置、安全监控",
          consPersonnel: "李响"
        },
        {
          date: "2023-7-20",
          detail: "验收，交工",
          passImg: require("@/assets/images/pass.png")
        }
      ],
      status: "1",
      afterSalesLine: [
        {
          date: "2023-7-21",
          detail: "保养智能防走失装置",
          consPersonnel: "李响"
        }
      ]
    };
  }
};
</script>
<style scoped lang="scss">
.title {
  margin: 20px 0;
  font-weight: 600;
}
.operate {
  float: right;
  margin: 10px 0;
  .el-button {
    margin-right: 10px;
  }
}
.el-steps {
  clear: both;
}
.ability-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  .logo {
    width: 24px;
    height: 24px;
    // margin: 0 10px 0 0;
  }
  .donelogo {
    width: 44px;
    height: 44px;
  }
  //   span {
  //     margin-bottom: 10px;
  //   }
}
.user-container {
  color: #373737 !important;
}
</style>
